﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using LEET.LEETCommon.Model;
using LEET.LEETCommon;
using LEET.CommonInterfaces.TestControls;
using Compiled_Tests;

namespace LEET.StandardModuals.Instructions
{
    public class EmbeddedScript : Instruction
    {
        String ScriptName {get;set;}

        public EmbeddedScript(String [] args)
            : base(args)
        {
            ScriptName = args[1].Trim();
            InstructionType = NodeTypes.EMBED_TYPE;
            Name = ScriptName;
        }

        public static IAutomationActionResult Embed(ITestScript script)
        {
            return new AutomationActionResult(script);
        }

        public override String RenderStaticCall()
        {
            return "LEET.StandardModuals.Instructions.EmbeddedScript.Embed(new "+ScriptName+"())";
        }

        public override string PlainText()
        {
            return "Run embedded script " + ScriptName;
        }
    }
}
